import request from '@/config/axios'

export interface PartVO {
  id: number
  partCode: string
  partName: string
  partDescription: string
  departid: string
  partSorter: number
  enabled: string
}

// 查询厂区列表
export const getPartPage = async (params: PartPageReqVO) => {
  return await request.get({ url: `/lims/part/page`, params })
}

// 查询厂区详情
export const getPart = async (id: number) => {
  return await request.get({ url: `/lims/part/get?id=` + id })
}

// 新增厂区
export const createPart = async (data: PartVO) => {
  return await request.post({ url: `/lims/part/create`, data })
}

// 修改厂区
export const updatePart = async (data: PartVO) => {
  return await request.put({ url: `/lims/part/update`, data })
}

// 删除厂区
export const deletePart = async (id: number) => {
  return await request.delete({ url: `/lims/part/delete?id=` + id })
}

// 导出厂区 Excel
export const exportPart = async (params) => {
  return await request.download({ url: `/lims/part/export-excel`, params })
}
